<!--<div ng-controller="shortMessageListCtrl">-->
<!--<div ng-controller="chatMessageListCtrl">-->
<div ng-controller="chatMessageListCtrl"><!--TODO:test-->
    <!--不能写两个ng-controller，否则会导致不能传递参数-->
    <!--相同的ng-controller的操作应该放在同一个div下-->

    <form class="form-inline" role="form">
        <table>
            <tr>
                <!--old，发送人username， 2015-4-14
                <td>
                    <div class="input-group">
                        <label class="control-label" >发送人username:</label>
                        <input type="text" class="form-control" placeholder="发送人username" ng-model="shortMessage.inputFrom" ng-init="">
                    </div><br>
                </td>-->
                <td>
                    <div class="input-group">
                        <label class="control-label" >某人的username:</label>
                        <input type="text" class="form-control" placeholder="某人的username" ng-model="shortMessage.inputFrom" ng-init="">
                    </div><br>
                </td>

                <!--<td>
                    <div class="input-group">
                        <label class="control-label" >接收人的username:</label>
                        <input type="text" class="form-control" placeholder="接收人的username" ng-model="shortMessage.to" ng-init="">
                    </div><br>
                </td>-->
                <!--<td>
                    <div class="input-group">
                        <label class="control-label" >验证码:</label>
                        <input type="text" class="form-control" placeholder="验证码" ng-model="shortMessage.verificationCode" ng-init="">
                    </div><br>
                </td>-->
                <!--<td>
                    <div class="input-group">
                        <label class="control-label" >消息类型:</label>
                        <input type="text" class="form-control" placeholder="txt:文本消息, img:图片, loc：位置, audio：语音" ng-model="shortMessage.messageType" ng-init="">
                    </div><br>
                </td>-->
            </tr>
            <tr>
                <!-- <td>
                     <div class="input-group">
                         <label class="control-label" >消息内容:</label>
                         <input type="text" class="form-control" placeholder="消息内容" ng-model="shortMessage.message" ng-init="">
                     </div><br>
                 </td>-->
                <!--<td>
                    <div class="input-group">
                        <label class="control-label" >单聊还是群聊:</label>
                        <input type="text" class="form-control" placeholder="chat:单聊，groupchat:群聊" ng-model="shortMessage.status" ng-init="">
                    </div><br>
                </td>-->
                <td>
                    <div class="input-group">
                        <label class="control-label" >起始日期:</label>
                        <input type="text" class="form-control" placeholder="起始日期" ng-model="shortMessage.dateStart" ng-init="">
                    </div><br>
                </td>
                <td>
                    <div class="input-group">
                        <label class="control-label">终止日期:</label>
                        <input type="text" class="form-control" placeholder="终止日期" ng-model="shortMessage.dateEnd" ng-init="">
                    </div><br>
                </td>
                <td>
                    <div class="control-group">
                        <div class="controls">
                            <button type="submit" class="btn btn-sm" ng-click="searchChatMessage(shortMessage)" >搜索</button>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <div class="controls">
                            <!--TODO::后台service哪里用到这些参数了？
                            【1:{{scope_userId}}】
                            【2:{{shortMessage.userId='66customerService'}}】
                            <a href ng-click="searchChatMessage(shortMessage)" >搜索2:传userId</a>-->
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </form>
    </br>



    <!--TODO：test，某人和好友的聊天记录-->
    <!--<table ng-if="searchChatLogByTwoUser_results != null">【2：】
    &lt;!&ndash;<table ng-if="1 == 0">&ndash;&gt;
        &lt;!&ndash;
        <tr ng-repeat="friendUserId in shortMessageList.data">
        &ndash;&gt;
        <tr ng-repeat="friendUserId in searchChatLogByTwoUser_results.data">
            <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人：{{friendUserId}}</a></td>&lt;!&ndash;TODO::写死了&ndash;&gt;
        </tr>
    </table>-->

    <!--TODO::，test，改回来，2015-4-14
    <table ng-if="shortMessage.inputFrom != null">
        <tr ng-repeat="friendUserId in searchChatMessage_results.data">
            <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人：{{friendUserId}}</a></td>&lt;!&ndash;TODO::写死了&ndash;&gt;
        </tr>
    </table>-->


    <!--<table ng-if="shortMessage.inputFrom != null">
        <tr>
            <td>
                <table ng-if="shortMessage.inputFrom != null">
                <tr ng-repeat="friendUserId in searchChatMessage_results.data">
                    <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人1：{{friendUserId}}</a></td>&lt;!&ndash;TODO::写死了&ndash;&gt;
                </tr>
                </table>
            </td>&lt;!&ndash;TODO::写死了&ndash;&gt;

            <td>
                <table ng-if="shortMessage.inputFrom != null">
                    <tr ng-repeat="friendUserId in searchChatMessage_results.data">
                        <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人1：{{friendUserId}}</a></td>&lt;!&ndash;TODO::写死了&ndash;&gt;
                    </tr>
                </table>
            </td>
        </tr>
    </table>-->


    </br>
    <ul class="nav nav-tabs">
        <!--查询全部人 的聊天记录-->
        <li ng-if="shortMessage.inputFrom == null" class="active"><a href="#tab_a" data-toggle="tab">全部的 聊天记录</a></li>
        <!--查询某人 的聊天记录-->
        <li ng-if="shortMessage.inputFrom != null" class="active"><a href="#tab_a" data-toggle="tab">{{shortMessage.inputFrom}} 的聊天记录</a></li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="tab_a">

            <!--TODO::最外层的大table-->
            <table ng-if="shortMessage.inputFrom != null">
                <tr>
                    <td class="ui-menu"> <!--"bottom"--> <!--大table的第一列-->
                        <table ng-if="shortMessage.inputFrom != null"  class="account-bg"  ><!--"table table-condensed" "accordion-boxed""account-bg"--> <!--class="ui-tabs-nav"-->
                            <!--【{{shortMessage.inputFrom}} 的联系人列表】-->
                            <ul class="nav nav-tabs">
                                <li ng-if="shortMessage.inputFrom != null" class="active"><b>{{shortMessage.inputFrom}} 的联系人列表</b></li>
                            </ul>

                            <tr ng-repeat="friendUserId in searchChatMessage_results.data">
                                <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人：{{friendUserId}}</a></td><!--TODO::写死了-->
                            </tr>
                        </table>
                    </td><!--TODO::写死了-->

                    <td><!--大table的第二列-->
                        <!--<table ng-if="shortMessage.inputFrom != null">
                            <tr ng-repeat="friendUserId in searchChatMessage_results.data">
                                <td><a href ng-click="searchChatLogByTwoUser(shortMessage.inputFrom, friendUserId)" >联系人1：{{friendUserId}}</a></td>&lt;!&ndash;TODO::写死了&ndash;&gt;
                            </tr>
                        </table>-->



                        <!--查询全部人 的聊天记录-->
                        <table ng-if="shortMessage.inputFrom == null" class="table table-condensed" width="">
                            <thead>
                            <tr>
                                <th>发送人username<!--deviceId--></th>
                                <th>接收人的username<!--mobilePhone--></th>
                                <!--<th>消息id&lt;!&ndash;verificationCode&ndash;&gt;</th>-->
                                <!--<th>单聊还是群聊&lt;!&ndash;messageId&ndash;&gt;</th>-->
                                <th>消息内容<!--errCode--></th>
                                <th>消息发送时间<!--status--></th>
                                <th>消息类型<!--dateCreated--></th>

                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="shortMessage in shortMessageList.data">
                                <!--<tr ng-repeat="shortMessage in shortMessageList"><!--TODO:test-->
                                <td>{{shortMessage.from}}</td>
                                <td>{{shortMessage.to}}</td>
                                <!--<td>{{shortMessage.messageId}}</td>-->
                                <!--<td>{{shortMessage.chatType}}</td>-->
                                <td>{{shortMessage.message}}</td>
                                <td>{{shortMessage.messageTime}}</td>
                                <td>{{shortMessage.messageType}}</td>

                                <!--<td>{{shortMessage.dateCreated | date:'yyyy-mm-dd'}}</td>-->
                            </tr>
                            </tbody>
                        </table>



                        <!--查询某人 的聊天记录-->
                        <table ng-if="shortMessage.inputFrom != null" class="table table-condensed" width="">
                            <thead>
                            <tr>
                                <!--<th>发送人username&lt;!&ndash;deviceId&ndash;&gt;</th>
                                <th>接收人的username&lt;!&ndash;mobilePhone&ndash;&gt;</th>-->
                                <!--<th>消息id&lt;!&ndash;verificationCode&ndash;&gt;</th>-->
                                <!--<th>发送人&lt;!&ndash;messageId&ndash;&gt;</th>-->
                                <th>{{scope_searchChatLogByTwoUser_friendUserId}} 发的消息内容<!--errCode--></th>
                                <th>{{shortMessage.inputFrom}} 发的消息<!--errCode--></th>
                                <th>消息发送时间<!--status--></th>
                                <!--<th>消息类型&lt;!&ndash;dateCreated&ndash;&gt;</th>-->

                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="shortMessageItem in shortMessageList.data">
                                <!--<tr ng-repeat="shortMessage in shortMessageList"><!--TODO:test-->
                                <!--<td>{{shortMessage.from}}</td>
                                <td>{{shortMessage.to}}</td>-->
                                <!--<td>{{shortMessageItem.messageId}}</td>-->


                                <!--发送人-->
                                <!--<td ng-if="shortMessageItem.from != shortMessage.inputFrom"><b>{{shortMessageItem.from}}</b></td>
                                &lt;!&ndash;TODO，test，写死的改回来&ndash;&gt;
                                <td ng-if="shortMessageItem.from == shortMessage.inputFrom"></td>-->

                                <!--<td>{{shortMessageItem.from}}</td>-->

                                <!--别人发的消息-->
                                <td ng-if="shortMessageItem.from != shortMessage.inputFrom">{{shortMessageItem.message}} <img ng-if="shortMessageItem.url != null" src="{{shortMessageItem.url}}"></td>
                                <td ng-if="shortMessageItem.from == shortMessage.inputFrom"></td>

                                <!--要查询的某人发的消息-->
                                <!--<td ng-if="shortMessage.from == 66customerService"><b>if.{{shortMessage.message}}</b></td>-->
                                <td ng-if="shortMessageItem.from == shortMessage.inputFrom">{{shortMessageItem.message}} <img ng-if="shortMessageItem.url != null" src="{{shortMessageItem.url}}"></td>
                                <td ng-if="shortMessageItem.from != shortMessage.inputFrom"></td>


                                <td>{{shortMessageItem.messageTime}}</td>
                                <!--<td>{{shortMessageItem.messageType}}</td>-->

                                <!--<td>{{shortMessage.dateCreated | date:'yyyy-mm-dd'}}</td>-->
                            </tr>
                            </tbody>
                        </table>



                        <!--大table结尾-->
                    </td>
                </tr>
            </table>
            <!--大table结尾-->

        </div>

    </div>

</div>